package com.pz.art.mapper;

import com.pz.art.domain.AssoMember;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @params
 * @note 会员mapper
 * @date
 * @author lw
 */
@Mapper
public interface MemberMapper {

    /**
     * 获取单位会员列表
     *
     * @return 所有的单位会员信息
     */
    public List<AssoMember> selectAllMember(AssoMember member);

    /**
     * 获取普通会员列表
     *
     * @return 所有的普通会员信息
     */
    public List<AssoMember> selectNormalAllMember(AssoMember member);

    /**
     * 查询表ID会员信息
     *
     * @param id 会员ID
     * @return 会员信息
     */
    public AssoMember selectMemberById(Integer id);

    /**
     * 添加会员信息
     *
     * @note 传入会员信息
     * @return 返回成功、失败
     */
    public int insertMember(AssoMember assoMember);

    /**
     * 编辑会员信息
     *
     * @note 传入会员信息
     * @return 返回成功、失败
     */
    public int updateMember(AssoMember assoMember);
    /**
     * 查询会员
     *
     * @param id 会员主键
     * @return 会员
     */
    public AssoMember selectAssoMemberById(Long id);

    /**
     * 查询会员列表
     *
     * @param assoMember 会员
     * @return 会员集合
     */
    public List<AssoMember> selectAssoMemberList(AssoMember assoMember);

    /**
     * 新增会员
     *
     * @param assoMember 会员
     * @return 结果
     */
    public int insertAssoMember(AssoMember assoMember);

    /**
     * 修改会员
     *
     * @param assoMember 会员
     * @return 结果
     */
    public int updateAssoMember(AssoMember assoMember);

    /**
     * 删除会员
     *
     * @param id 会员主键
     * @return 结果
     */
    public int deleteAssoMemberById(Long id);

    /**
     * 批量删除会员
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAssoMemberByIds(Long[] ids);

    public List<AssoMember> getAssomemberByUnitId(Long unit_id);

    public AssoMember selectMemberByPhoneNo(String phone);

    public int updateAssoMemberUnit(@Param("ids")Long[] ids, @Param("unit_id")Long unit_id,@Param("unit_boolean")Integer unit_boolean);

    public int insertjoinAssomember(@Param("ids")Long[] ids, @Param("unit_id")Long unit_id,@Param("events_id")Long events_id);

    AssoMember getNormalByPhone(String phone);

    void updatememberinitiation(@Param("status")Integer status, @Param("member_id")Long member_id, @Param("type")String type, Date nowDate);
}
